import pxssh  

ips = (,,,,,)

username = 'username'
password = 'password'
command = 'uname -n'


def auto_ssh_cmd(ip,username,password,command,port=22):  
    try:  
        remote = pxssh.pxssh()  
        remote.login(ip,username,password)  
        remote.sendline(command)  
        remote.prompt()  
        print remote.before  
        remote.logout()  
    except pxssh.ExceptionPxssh, e:  
        print "pxssh failed on login."  
        print str(e)  
        print ip

def mass_ssh():
    for ip in ips:
        auto_ssh_cmd(ip,username,password,command)
    #map() ...


mass_ssh()